<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head th:include="include :: header">
    <style type="text/css">
        input,select{
            box-sizing: border-box;
        }
    </style>
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-content">
                    <form class="form-horizontal m-t" id="teacherForm"  >
                        <input id="userId" name="userId" th:value="${teacher.userId}" hidden>
                        <div class="form-group" >
                            <label class="col-sm-2 control-label" >教师编号</label>
                            <div class="col-sm-4 form-inline">
                                <input class="form-control" type="text" style="width: 100%" th:value="${teacher.username}"
                                       id="username" name="username" disabled>
                            </div>
                            <label class="col-sm-2 control-label" >教师名称</label>
                            <div class="col-sm-4 form-inline">
                                <input class="form-control" type="text" style="width: 100%" th:value="${teacher.name}"
                                       id="name" name="name" disabled>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label" >教师性别</label>
                            <div class="col-sm-4 form-inline">
                                <select class="form-control" id="sex" name="sex" style="width: 100%">
                                    <option value="-1" th:selected="${teacher.sex} == -1">-请选择性别-</option>
                                    <option value="0" th:selected="${teacher.sex} == 0">男</option>
                                    <option value="1" th:selected="${teacher.sex} == 1">女</option>
                                </select>
                            </div>
                            <label class="col-sm-2 control-label" >邮箱:</label>
                            <div class="col-sm-4 form-inline">
                                <input class="form-control" type="text" style="width: 100%" th:value="${teacher.email}"
                                       id="email" name="email">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label" >联系电话</label>
                            <div class="col-sm-4 form-inline">
                                <input class=" form-control" type="text" style="width: 100%" th:value="${teacher.mobile}"
                                       id="mobile" name="mobile">
                            </div>
                            <label class="col-sm-2 control-label" >是否校内教师</label>
                            <input id="cole" th:value="${teacher.teacherFrom}" hidden>
                            <div class="col-sm-4 form-inline">
                                <select class="form-control" id="teacherFrom" name="teacherFrom"
                                    style="width: 100%" onchange="teacher()">
                                    <option value="-1" th:selected="${teacher.teacherFrom} == -1">-请选择-</option>
                                    <option value="0" th:selected="${teacher.teacherFrom} == 0">是</option>
                                    <option value="1" th:selected="${teacher.teacherFrom} == 1">否</option>
                                </select>
                            </div>
                        </div>

                        <div class="form-group" >
                            <label class="col-sm-2 control-label" style="display: none;" id="a">教师所属学院</label>
                            <div class="col-sm-4 form-inline" style="display: none;" id="b">
                                <input class=" form-control" type="text" style="width: 100%" th:value="${teacher.teacherCollege}"
                                       id="teacherCollege" name="teacherCollege">
                            </div>
                            <label class="col-sm-2 control-label" style="display:none;" id="c">教师所在公司或机构</label>
                            <div class="col-sm-4 form-inline" style="display:none;" id="d">
                                <input class=" form-control" type="text" style="width: 100%" th:value="${teacher.teacherCompany}"
                                       id="teacherCompany" name="teacherCompany">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label" >教师信息描述</label>
                            <div class="col-sm-9">
                                <input class=" form-control" type="text" style="width: 100%" th:value="${teacher.teacherDescription}"
                                       id="teacherDescription" name="teacherDescription">
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-8 col-sm-offset-5">
                                <button type="submit" id="submit" class="btn btn-primary" >提交</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript">
    function teacher() {
        var a = $('#teacherFrom').val();
        if (a == 0){
            document.getElementById("a").style.display="block";
            document.getElementById("b").style.display="block";
            document.getElementById("c").style.display="none";
            document.getElementById("d").style.display="none";
        }else if (a == 1){
            document.getElementById("a").style.display="none";
            document.getElementById("b").style.display="none";
            document.getElementById("c").style.display="block";
            document.getElementById("d").style.display="block";
        }else if (a == -1) {
            document.getElementById("a").style.display="none";
            document.getElementById("b").style.display="none";
            document.getElementById("c").style.display="none";
            document.getElementById("d").style.display="none";
        }
    }

</script>
<script type="text/javascript" src="/js/appjs/sys/teacher/edit.js">
</script>
</body>
</html>
